package com.lsy.weizhi2.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.lsy.weizhi2.R;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by 嗨哟 on 2017/3/16.
 */
public class HeadImageAdapter extends RecyclerView.Adapter<HeadImageAdapter.HeadImageHolder> {
    private Context context;
    private List<?> list;
    private LayoutInflater layoutInflater;

    public HeadImageAdapter(Context context, List<?> list) {
        this.context = context;
        this.list = list;
        layoutInflater=LayoutInflater.from(context);
    }

    @Override
    public HeadImageHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = layoutInflater.inflate(R.layout.headitem,parent,false);
        AutoUtils.autoSize(view);
        return new HeadImageHolder(view);
    }

    @Override
    public void onBindViewHolder(HeadImageHolder holder, int position) {
        holder.position=position;
        holder.head_tv.setText(position+"");
       /* if(position==9){
            holder.head_tv.setVisibility(View.GONE);
            holder.head_iv.setAlpha(0.6f);
            holder.head_gengduo.setVisibility(View.VISIBLE);
        }*/
    }

    @Override
    public int getItemCount() {
        return 10;
    }

    class HeadImageHolder extends RecyclerView.ViewHolder{
        int position;
        ImageView head_iv,head_gengduo;
        TextView head_tv;
        public HeadImageHolder(View itemView) {
            super(itemView);
            head_iv= (ImageView) itemView.findViewById(R.id.head_iv);
            head_tv= (TextView) itemView.findViewById(R.id.head_tv);
            head_gengduo= (ImageView) itemView.findViewById(R.id.head_gengduo);
        }
    }
}
